﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace NJL.WebManage.SystemNotice
{
    public partial class AddSystemNotice :BasePage
    {
        NJL.BLL.NJL_SYS_ANNOUNCEMENT bll = new BLL.NJL_SYS_ANNOUNCEMENT();
        NJL.Model.NJL_SYS_ANNOUNCEMENT model = new Model.NJL_SYS_ANNOUNCEMENT();
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }

        protected void btnSubmit_Click(object sender, EventArgs e)
        {

            model.ID = DateTime.Now.ToString("yyyyMMddHHmmssfff") + new Random().Next(100, 999).ToString();
            model.ANNOUNCEMENT_NAME = txtTitle.Text.Trim();
            model.ANNOUNCEMENT_CONTENT = txtContent.Text.Trim();
            model.CREATE_DATE_TIME = DateTime.Now;
            model.CREATE_USER_ID = USER_ID;
            model.CREATE_USER_NAME = USER_NAME;
            model.NJL_SYS_BASE_ID = WEBSITE_CODE;
            model.IS_PUBLISH = 0;
            model.SORT = int.Parse(txtSort.Text.Trim());
            if (bll.Add(model))
            {
                Royalsoft.Common.MessageBox.ShowAndRedirect(this, "添加成功", "AddSystemNotice.aspx");
            }        
        }
    }
}